<div class="col mb-4">
  <div class="card creator-card">
    <% if creator.remote? %>
      <div class='card-header'>
        <%= server_indicator creator %>
      </div>
    <% end %>
    <div class="card-body <%= "remote-actor" if creator.remote? %>">
      <div class="row">
        <% if creator.avatar %>
          <div class="col col-auto">
            <%= Avatar(url: avatar_creator_path(creator), size: :large) %>
          </div>
        <% end %>
        <div class="col">
          <div class="card-title">
            <%= creator.name %>
            <%= AccessIndicator object: creator %>
          </div>
          <% if creator.caption %>
            <div>
              <span class="card-subtitle mb-2 text-muted"><%= sanitize creator.caption %></span>
            </div>
          <% end %>
          <%= LinkList links: creator.links %>
        </div>
      </div>
    </div>
    <div class='card-footer'>
      <div class='row'>
        <% model_count = policy_scope(Model).where(creator: creator).count %>
        <% collection_count = policy_scope(Collection).where(creator: creator).count %>
        <div class='col'>
          <%= if policy(creator).show?
                GoButton(
                  label: "#{model_count} #{Model.model_name.human count: model_count}",
                  aria_label: creator.remote? ?
                    translate(".models_button.remote_label", name: creator.name) :
                    translate(".models_button.label", name: creator.name),
                  href: creator_path(creator),
                  variant: "primary"
                )
              end %>
          <%= if policy(creator).show? && !creator.collections.empty?
                GoButton(
                  label: "#{collection_count} #{Collection.model_name.human count: collection_count}",
                  aria_label: creator.remote? ?
                    translate(".collections_button.remote_label", name: creator.name) :
                    translate(".collections_button.label", name: creator.name),
                  href: collections_path(creator: creator),
                  variant: "primary"
                )
              end %>
        </div>
        <div class='col col-auto'>
          <%= BurgerMenu do %>
            <%= DropdownItem(icon: "pencil", label: translate("general.edit"), path: edit_creator_path(creator), aria_label: translate(".edit_button.label", name: creator.name)) if policy(creator).edit? %>
            <%= DropdownItem(icon: "trash", label: translate("general.delete"), path: creator_path(creator), method: :delete, aria_label: translate(".delete_button.label", name: creator.name), confirm: t("creators.destroy.confirm")) if policy(creator).destroy? %>
            <%= DropdownItem(icon: "flag", label: translate("general.report", type: ""), path: new_creator_report_path(creator)) if SiteSettings.multiuser_enabled? %>
          <% end %>
        </div>
      </div>
    </div>
  </div>
</div>
